{include file="public/header"}
<title>详情</title>

</head>
<style>
    .formControls {
        padding-top: 3px;
    }

    .form-horizontal .form-label {
        text-align: left;
    }

    .form-label {
        float: left !important;
        width: 170px !important;
    }

    .formControls {
        float: left !important;
        margin-left: 30px;
    }

    .row {
        margin-left: 65px !important;
    }

    label, .placeholder {
        font-size: 16px !important;
        font-weight: 100 !important;
    }

    h2 {
        clear: both;
        border-bottom: 1px solid #ccc;
        font-size: 21px;
    }

    .page-container {
        padding: 0px 17px 0px 0px;
    }
</style>
<body>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-member-add"
          style="margin-left: 48px;padding-bottom: 40px;">
        <h2 style="clear: both"><span class="glyphicon glyphicon-file"></span>订单信息</h2>
        <div class="row cl">
            <label class="form-label">渠道：</label>
            <div class="formControls" style="float: right">
                {$data.title}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">问题：</label>
            <div class="formControls">
                {$data['pro_id']}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">地址：</label>
            <div class="formControls">
                <td><span style="margin-right: 40px">{$data['province']}</span>
                    <span style="margin-right: 40px">{$data['city']}</span>
                    <span style="margin-right: 40px">{$data['county']}</span><span>{$data['addres']}</span></td>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">联系人：</label>
            <div class="formControls">
                {$data.contacts}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">联系电话：</label>
            <div class="formControls">
                {$data.telephone}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">下单时间：</label>
            <div class="formControls">
                {:date('Y-m-d H:i:s',$data.created_time)}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">备注：</label>
            <div class="formControls">
                {$data.remarks}
            </div>
        </div>
        {if condition="$data.state != 0"}
        <div class="row cl">
            <label class="form-label">指派店长：</label>
            <div class="formControls">
                {$data.username}
            </div>
        </div>
        {if condition="$data.planned"}
        <div class="row cl">
            <label class="form-label">预计上门时间：</label>
            <div class="formControls">
                <?php if(!empty($data['planned'])){?> {:date('Y-m-d H:i:s',$data.planned)}  <?php } ?>

            </div>
        </div>
        {/if}
        {/if}
        <div class="row cl">
            <label class="form-label">图片：</label>
            <div class="formControls">
                <?php if(is_array($data['logo'])) foreach($data['logo'] as $user){ ?>
                <img style="width: 100px;height: 100px;margin-right: 15px" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        <h2 style="clear: both;margin-top: 16px"><span class="glyphicon glyphicon-file"></span>订单状态</h2>

        <div class="row cl">
            <label class="form-label">状态：</label>
            <div class="formControls">
                {$data.states}
            </div>
            {if condition="$data.state == 8"}
            <label class="form-label" style="margin-left: 25%;">取消原因：</label>
            <div class="formControls">
                {$data.reason}
            </div>

        </div>
        <div class="row cl">
            <label class="form-label">时间：</label>
            <div class="formControls">
                <?php if(!empty($data['tui_time'])){?> {:date('Y-m-d H:i:s',$data.tui_time)}  <?php } ?>

            </div>
        </div>
        {/if}

        {if condition="$data.state == 9"}
        <label class="form-label" style="margin-left: 25%;">退单原因：</label>
        <div class="formControls">
            {$data.reason}
        </div>
        </div>
        <div class="row cl">
            <label class="form-label">时间：</label>
            <div class="formControls">
                <?php if(!empty($data['tui_time'])){?> {:date('Y-m-d H:i:s',$data.tui_time)}  <?php } ?>

            </div>
        </div>
        <div class="row cl">
            <label class="form-label">退单金额：</label>
            <div class="formControls">
                {$data.tui_moey}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">退单状态：</label>
            <div class="formControls">
                <?php if($data['tui_state']==1){?> 审核中  <?php }elseif($data['tui_state']==2){ ?>
                已通过
                <?php }?>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label">备注：</label>
            <div class="formControls">
                {$data.tui_shen}
            </div>
        </div>
        {/if}
        </div>
        <?php if(!empty($through)){?>
        <h2><span class="glyphicon glyphicon-file"></span>远程沟通</h2>
        <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 8px;">
            <thead>
            <tr class="text-c">

                <th width="80">方式</th>
                <th width="80">金额</th>
                <th width="80">成交</th>
                <th width="80">沟通时间</th>
                <th width="80">备注</th>
            </tr>
            </thead>
            <tbody>
            {volist name='through' id='vo'}
            <tr class="text-c">
                <td>{$vo.mode}</td>
                <td>{$vo.amount}</td>
                <td><?php if($vo['baocun']==1){   ?> <span style="color: red">已成交</span> <?php }else{  ?>沟通中 <?php } ?>
                </td>
                <td><?php echo date('Y-m-d H:i:s',$vo['th_time']) ?></td>
                <td style="padding: 0">{$vo.remar}</td>
            </tr>

            {/volist}
            </tbody>
        </table>
        <div class="pages" style="float: right">{$through->render()}</div>
        <?php }?>
        <?php if($data['state'] !=0  && $data['state'] !=1 && $data['state'] !=2 ){ ?>
        <h2><span class="glyphicon glyphicon-file"></span>基检信息</h2>

        <a style="text-decoration:none" data-id="{$data.order_id}" class="btn btn-primary ji "  href="javascript:;" title="新增"><span class="label label-primary">新增</span></a>
        <table class="table table-border table-bordered table-bg table-hover table-sort" style="margin-top: 8px;">
        <thead>
        <tr class="text-c">
        <!--<th width="80">序号</th>-->
        <th width="80">一级</th>
        <th width="80">二级</th>
        <th width="80">三级</th>
        <th width="80">分类</th>
        <th width="80">名称</th>
        <th width="80">方量</th>
        <th width="80">价格</th>
        <th width="80">规则</th>
        <th width="80">质保</th>
        <th width="80">基建时间</th>
        <th width="80">施工天数</th>
        <th width="80">图片</th>
        <!--<th width="80">优惠金额</th>-->
        <th width="80">赠送项目</th>
        <th width="80">备注</th>
        <th width="80">总金额</th>

        <!--<th width="80">删除</th>-->

        </tr>
        </thead>
        <tbody>
        {volist name='capital' id='vo'}
        <tr class="text-c">
        <!--<td class="col-1">{$vo.capital_id}</td>-->
        <td style="width:5%">{$vo.wen_a}</td>
        <td style="width:5%">{$vo.wen_b}</td>
        <td style="width:5%">{$vo.wen_c}</td>
        <td style="width:5%">{$vo.class_a}</td>
        <td class="col-1"><textarea style="border: none;padding:5px;resize:none;background: white;overflow:auto;height:100px;width:100px;" disabled="disabled">{$vo.class_b}</textarea></td>
        <td class="col-1">{$vo.square}/{$vo.company}</td>
        <td class="col-1">{$vo.un_Price}</td>
        <td class="col-1" style="padding: 0"><textarea style="border: none;width:100px;padding:5px;resize:none;background: white;overflow:auto;height:100px" disabled="disabled">{$vo.rule}</textarea></td>

        <!--<td >{$vo.rule}</td>-->
        <td style="width:4.7%;"><?php if($vo['zhi'] ==1){ ?>是<?php }else{ ?>否<?php }?></td>
        <td style="width:10%;font-size: 10px;">{:date('Y-m-d H:i:s',$vo.crtime)}</td>
        <td style="width:5%;">{$vo.gong}</td>

        <td style="width: 6%"> <?php if(is_array($vo['capitalgo'])) foreach($vo['capitalgo'] as $user){ ?>
        <img style="width:75%;" src="<?php echo $user ?>">
        <?php } ?></td>
        <!--<td >{$vo.give_money}</td>-->
        <td class="col-1" style="padding: 0"><textarea style="border: none;padding:5px;width:75px;resize:none;background: white;overflow:auto;height:100px;font-size: 10px" disabled="disabled">{$vo.give_d}</textarea></td>
        <td class="" style="padding:2px;text-align:left;width: 4.5%;
font-size:10px;">{$vo.give_remarks}</td>
        <td class="col-1">{$vo.to_price}</td>
        <!--<td><a style="text-decoration:none" class="ml-5 del1"  data-id="{$vo.capital_id}" href="javascript:;" title="取消"><span class="btn btn-default">取消</span></a></td>-->
        </tr>

        {/volist}
        </tbody>
        </table>
        <span>优惠总金额：<span style="color: red">¥：{$c}</span></span>
        <div class="pages" style="float: right">{$capital->render()}</div>
        <?php if(!empty($data['label_id'])){ ?>
        <h2><span class="glyphicon glyphicon-file"></span>重点标签</h2>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">标签：</label>

            <div class="formControls col-xs-8 col-sm-9">
                {volist name='label' id='vo'}
                {$vo.content}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                {/volist}

            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>

            <div class="formControls col-xs-8 col-sm-9">
                {$data.inside}

            </div>
        </div>
        <?php } ?>

        <?php }?>
        <?php if($data['state'] !=0  && $data['state'] !=1 && $data['state'] !=2 && $data['state'] !=3 ){ ?>

        <h2 style="clear: both;margin-top: 16px"><span class="glyphicon glyphicon-file"></span>签约信息</h2>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">签约时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(!empty($data['con_time'])){?> {:date('Y-m-d H:i:s',$data.con_time)}  <?php } ?>

            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">定金金额：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.dep_money}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">签约合同：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(is_array($data['contract'])) foreach($data['contract'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">定金合同：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(is_array($data['deposit']))foreach($data['deposit'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        <?php if($data['state'] >= 5 ){ ?>
        {if condition="$data.startup_id != 0"}
        <h2><span class="glyphicon glyphicon-file"></span>开工信息</h2>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">开工款</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.dep}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">开工时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(!empty($data['sta_time'])){?> {:date('Y-m-d H:i:s',$data.sta_time)}  <?php } ?>

            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">预计完工日期：</label>
            <div class="formControls col-xs-8 col-sm-9">

                <?php if(!empty($data['up_time'])){?> {:date('Y-m-d H:i:s',$data.up_time)}  <?php } ?>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.con}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">开工款发票：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(is_array($data['invoice']))foreach($data['invoice'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        {/if}
        <?php if($data['state'] ==6 || $data['state']==7){ ?>
        <h2 style="clear: both;margin-top: 16px"><span class="glyphicon glyphicon-file"></span>订单信息费用</h2>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">实际完工时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(!empty($data['uptimes'])){?> {:date('Y-m-d H:i:s',$data.uptimes)}  <?php } ?>

            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">总人工时长：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.shichang}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">尾款金额：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.tail}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">实际收款：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.total}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">实际总价：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.totalprice}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">优惠价：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.discount}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">人工成本：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.artificial}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">材料成本：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.material}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">图片：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(is_array($data['logos']))foreach($data['logos'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        <?php }?>
        <?php if($data['state']==7){ ?>
        {if condition="$data.product_id != 0"}
        <h2 style="clear: both;margin-top: 16px"><span class="glyphicon glyphicon-file"></span>订单评价信息</h2>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">打分：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.score}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">介绍意愿度：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.full}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">反馈信息：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.content}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">哪些服务不满意：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.dissatisfied}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">体验最好的地方：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.best}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">电话是否接通：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.connect}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">回访人：</label>
            <div class="formControls col-xs-8 col-sm-9">
                {$data.people}
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3">回访时间：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <?php if(!empty($data['upda'])){?> {:date('Y-m-d H:i:s',$data.upda)}  <?php } ?>
            </div>
        </div>
        {/if}
        <?php }?>
        <?php }?>
        <?php }?>

    </form>
</article>

{include file="public/footer"}
<script>
    if ("{$data['state']}" != 8) {
        $('.qu').css('display', 'none');
        $('.re').css('display', 'none');
        $('.username').css('display', 'none');
    } else if ("{$data['state']}" != 0) {
        $('.username').css('display', 'none');
        $('.qu').css('display', 'black');
        $('.re').css('display', 'black');
    } else {
        $('.username').css('display', 'black')
    }
    /**
     * 基建
     */
    $('.ji').click(function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/ji')}";
        layer.open({
            type: 2,
            area: ['800px', '700px'],
            fix: false,
            maxmin: true,
            shade: 0.4,
            title: '基检添加',
            content: src + '?type=2&order_id=' + id
        });
    });
    /**
     * 基建
     */
    $('.del1').click(function () {
        var capital_id = $(this).attr('data-id');
        var src = "{:Url('index/order/del1')}";
        layer.confirm('确认要取消该基检么？', function (index) {
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    capital_id: capital_id,

                },
                success: function (data) {
                    var res = JSON.parse(data);
                    if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 2000}, function () {
                            setTimeout("window.parent.location.reload()", 1);
                        });
                    } else {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    });
</script>
</body>
</html>